﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Banner.ascx.cs" Inherits="XLDL.Admin.Banner" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
 <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<table cellspacing="1" class="txt">
    <tr>
        <td align="left" valign="middle" width="80">
            Hình ảnh:</td>
        <td> 
            <table cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left">
                       
                        <asp:Label ID="lbl_hinhanh" runat="server"></asp:Label>
                    </td>
                    <td width="40">
                        <asp:Button ID="Button_up" runat="server" onclick="Button_up_Click" 
                            Text="..." />
                    </td>
                    <td align="left">
                        <asp:FileUpload ID="FileUpload_hinhanh" runat="server"  />
                            
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="left" valign="middle" width="80">
            Link</td>
        <td>
            <asp:TextBox ID="txt_link" runat="server" Width="200px"></asp:TextBox>
            <asp:TextBox ID="txt_id" runat="server" BorderColor="White" BorderStyle="None" 
                ForeColor="White" ReadOnly="True" Width="30px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Hiển thị:</td>
        <td align="left">
            <asp:DropDownList ID="DropDownList_hienthi" runat="server">
                <asp:ListItem Value="1">True</asp:ListItem>
                <asp:ListItem Value="0">False</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td align="left" width="60">
            <asp:Button ID="Button_them" runat="server" onclick="Button_them_Click" 
                Text="Thêm" />
                    </td>
                    <td align="left" width="55px">
            <asp:Button ID="Button_sua" runat="server" Text="Sửa" onclick="Button_sua_Click" 
                            onclientclick="return kt_sua();" />
                    </td>
                    <td>
                        <asp:Button ID="Button_xoa" runat="server" Text="Xoá" 
                            onclick="Button_xoa_Click" onclientclick="return kt_xoa();" />
                    </td>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="Button_reset" runat="server" onclick="Button_reset_Click" 
                            Text="Reset" />
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            <asp:GridView ID="Luoi" runat="server" AutoGenerateColumns="False" 
                onselectedindexchanging="Luoi_SelectedIndexChanging">
                <Columns>
                    <asp:BoundField DataField="ngay_dang" HeaderText="Ngày" 
                        DataFormatString="{0:dd/MM/yyy}" >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="75px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="ID" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lbl_id" runat="server" Text='<%# Bind("id_banner") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Hình ảnh">
                        <ItemTemplate>
                            <table cellspacing="1" class="style1">
                                <tr>
                                    <td align="center">
                                        <asp:Image ID="hinh_anh" runat="server" AlternateText='<%# Eval("hinh_anh") %>' 
                                            ImageUrl='<%# "~/Images/"+Eval("hinh_anh") %>' Width="80px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <asp:Label ID="lbl_hinh_anh" runat="server" Text='<%# Eval("hinh_anh") %>'></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="link" HeaderText="Link" >
                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="hien_thi" HeaderText="Hiển thị" >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:CommandField SelectText="Chọn" ShowSelectButton="True" 
                        ButtonType="Button" />
                </Columns>
                <SelectedRowStyle BackColor="#CCCCCC" />
            </asp:GridView>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td align="right">
            <asp:Label ID="lbl_thongke" runat="server"></asp:Label>
        </td>
    </tr>
</table>
</ContentTemplate>
            <Triggers><asp:PostBackTrigger ControlID="Button_up" />
            <asp:PostBackTrigger ControlID="Button_sua" />
             <asp:PostBackTrigger ControlID="Button_them" />
             <asp:PostBackTrigger ControlID="Button_xoa" />
            </Triggers>
            </asp:UpdatePanel> 
